package com.mxw.product.controller;

import com.mxw.account.dto.AccountDTO;
import com.mxw.account.feign.AccountFeign2;
import com.mxw.commons.restful.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.math.BigDecimal;

/** @Description TODO @Author RingKo @Date 2021/8/25 15:48 @Version 1.0 */
@Slf4j
@RestController
@RequestMapping(value = "/product")
public class ProductController {
  @Resource private AccountFeign2 accountFeign2;

  @PostMapping("/testFeign")
  public Result<String> testFeign() {
    // feign调用
    return accountFeign2.testFeign(
        AccountDTO.builder().accountCode("aaa").amount(BigDecimal.ONE).build());
  }
}
